package net.seehealth.healthpad.application.adapter;

import java.util.ArrayList;
import java.util.List;

import net.seehealth.healthpad.ui.view.PopItemView;
import net.seehealth.healthpad.ui.view.TaskItemView;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class PopOnLineAdapter extends BaseAdapter {

	private List<String> mListData;
	private Context mContext;
	
	public PopOnLineAdapter(Context context) {
		this.mContext = context;
		mListData = new ArrayList<String>();
		// TODO Auto-generated constructor stub
	}
	public void setData(List<String> data){
		mListData.clear();
		mListData.addAll(data);
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return ((mListData == null) ? 0 : mListData.size());
	}

	@Override
	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = new PopItemView(mContext);
		}
		
		((PopItemView) convertView).updateView(mListData.get(position));

		return convertView;
	}

}
